<?php
/* @var $this TextEmotionController */
/* @var $model TextEmotion */

$this->breadcrumbs=array(
	'Text Emotions'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List TextEmotion', 'url'=>array('index')),
	array('label'=>'Create TextEmotion', 'url'=>array('create')),
	array('label'=>'Update TextEmotion', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete TextEmotion', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage TextEmotion', 'url'=>array('admin')),
);
?>


<?php
//print_r("passou2");
$listemotion = Yii::app()->session['listemotion'];
$totwords = Yii::app()->session['totwords'];
$title = Yii::app()->session['title'];
//print_r($listemotion);
//print_r($model);


?>
<h1>Resultado texto: <?php echo $title ?></h1>
<h3>
<?php 
foreach ($listemotion as $key => $value){
	$labels[] = $value['name'];
	$alfa = $value['qtd']/ $totwords;
	Echo ($value['name']."= Q:".$value['qtd']." A:".$alfa);
	$dados[] = ($value['qtd']/ $totwords)*100;
}
?>
</h3>


<h1>Grafico Barras</h1>
<?php 
$this->widget('application.extensions.cvisualizewidget.CVisualizeWidget',array(
    'data'=>array(
        'headings'=>$labels,
        'data'=>array(
            'Nova Musica' => $dados,          
        )
    ),
    'options' => array(
        'title'=>$title,
        'width'=>700,
        'height'=>250,
		'type' => 'bar'
    )
));
?>

<h1>Resultado Radar</h1>
<?php 
        $this->widget(
            'application.extensions.widgets.ChRadar', 
            array(
                'width' => 600,
                'height' => 300,
                'htmlOptions' => array(),
                'labels' => $labels,
                'datasets' => array(
                    array(
                        "fillColor" => "rgba(220,150,220,0.5)",
                        "strokeColor" => "rgba(220,150,220,1)",
                        "pointColor" => "rgba(220,150,220,1)",
                        "pointStrokeColor" => "#ffffff",
                        "data" =>$dados
                    )                  
                ),
                'options' => array()
            )
        ); 
    ?>
